package com.qding.park.manager.app.queue.handle;

import java.lang.reflect.InvocationTargetException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.qding.park.common.core.cache.service.CacheServiceFacade;
import com.qding.park.common.core.exceptions.BaseException;
import com.qding.park.common.core.exceptions.IExceptionHandle;
import com.qding.park.common.core.exceptions.business.adapter.AdapterException;
import com.qding.park.common.core.exceptions.business.manager.adapterfactory.AdapterProxyCreateFail;
import com.qding.park.common.core.redis.SerializeUtils;
import com.qding.park.manager.facade.queue.service.ReportFacade;
import com.qding.park.manager.pojo.ap.ApApproachRecord;
import com.qding.park.manager.pojo.queue.QueueMsg;

/**
  * @ClassName: ReserveDelayTimeoutHandle
  * @Description:车辆进场消息
  * @author Comsys-Administrator
  * @date 2016年10月20日 上午10:10:31
  *
  */
@Component("carInckeckHandle")
public class CarInckeckHandle extends AbstractReportHandle{
	
	@Autowired
	private ReportFacade  reportFacade;
	
	@Override
	void actualHandle(QueueMsg msg) throws BaseException {
		JSONObject data = (JSONObject) msg.getData();
		ApApproachRecord apApproachRecord=SerializeUtils.unSerialize(data.toJSONString(), ApApproachRecord.class);
		reportFacade.Park_ParkInSync(apApproachRecord);
	}

	@Override
	boolean failDiscardRollBacK(QueueMsg msg) {
		_log.error("车场进场消息回滚:"+msg);
		return true;
	}
	
	
}
